/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.support.wx.model;

/**
 * 
 * @author haolw
 * @time 2017/07/20
 */
public class WxOrder {
	private String appId;// 公众账号ID
	private String mchId;// 商户号
	private String subAppId;// 子商户公众账号ID
	private String subMchId;// 子商户号
	private String deviceInfo;// 设备号
	private String nonceStr;// 随机字符串
	private String sign;// 签名
	private String signType = "MD5"; // 签名算法
	private String tradeType;// 交易类型
	private String prepayId;// 预支付交易会话标识
	private String codeUrl;// 二维码链接

	private String returnCode;// 返回状态码
	private String returnMsg;// 返回信息
	private String resultCode;// 业务结果
	private String errCode;// 错误代码
	private String errCodeDes;// 错误代码描述

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getMchId() {
		return mchId;
	}

	public void setMchId(String mchId) {
		this.mchId = mchId;
	}

	public String getSubAppId() {
		return subAppId;
	}

	public void setSubAppId(String subAppId) {
		this.subAppId = subAppId;
	}

	public String getSubMchId() {
		return subMchId;
	}

	public void setSubMchId(String subMchId) {
		this.subMchId = subMchId;
	}

	public String getDeviceInfo() {
		return deviceInfo;
	}

	public void setDeviceInfo(String deviceInfo) {
		this.deviceInfo = deviceInfo;
	}

	public String getNonceStr() {
		return nonceStr;
	}

	public void setNonceStr(String nonceStr) {
		this.nonceStr = nonceStr;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getSignType() {
		return signType;
	}

	public void setSignType(String signType) {
		this.signType = signType;
	}

	public String getTradeType() {
		return tradeType;
	}

	public void setTradeType(String tradeType) {
		this.tradeType = tradeType;
	}

	public String getPrepayId() {
		return prepayId;
	}

	public void setPrepayId(String prepayId) {
		this.prepayId = prepayId;
	}

	public String getCodeUrl() {
		return codeUrl;
	}

	public void setCodeUrl(String codeUrl) {
		this.codeUrl = codeUrl;
	}

	public String getReturnCode() {
		return returnCode;
	}

	public void setReturnCode(String returnCode) {
		this.returnCode = returnCode;
	}

	public String getReturnMsg() {
		return returnMsg;
	}

	public void setReturnMsg(String returnMsg) {
		this.returnMsg = returnMsg;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public String getErrCode() {
		return errCode;
	}

	public void setErrCode(String errCode) {
		this.errCode = errCode;
	}

	public String getErrCodeDes() {
		return errCodeDes;
	}

	public void setErrCodeDes(String errCodeDes) {
		this.errCodeDes = errCodeDes;
	}

	public boolean success() {
		if ("SUCCESS".equals(returnCode) && "SUCCESS".equals(resultCode)) {
			return true;
		} else {
			return false;
		}
	}

	public boolean fail() {
		if ("FAIL".equals(returnCode) || "FAIL".equals(resultCode)) {
			return true;
		} else {
			return false;
		}
	}
}
